#pragma once

#include "GameController.h"
#include <string>


class IGameCommands;
class IRenderingManager;
class CInputController;
class ICameraImpl;
class IMeshStorage;
class IGameState;

class GameStateController : public IGameController
{
private:
   IGameCommands& m_commandsDispatcher;
   IGameState* m_intro;
   IGameState* m_mainMenu;
   IGameState* m_race;
   IGameState* m_activeState;

   std::string m_trackName;

public:
   GameStateController(IGameCommands& commandsDispatcher,
                       IRenderingManager& renderingManager, 
                       IMeshStorage& meshStorage,
                       CInputController& inputController,
                       ICameraImpl& cameraImpl);
   ~GameStateController(void);

   void update(float timeElapsed);

   void openMainMenu();

   void startRace(const std::string& trackName);

   void victory(UINT playerIdx);

   void closeGame();

   const std::string& getTrackName() const {return m_trackName;}
};
